﻿<!DOCTYPE html>
<html lang="ch">
<head style=" padding: 0px;
            margin: 0px;border: 0px;outline: 0;">
    <meta charset="utf-8">
    <title></title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link href="/static/css/bootstrap.css" rel="stylesheet"  />
    <!-- FontAwesome Styles-->
    <link href="/static/css/font-awesome.css" rel="stylesheet" />
    <!-- Custom Styles-->
    <link href="/static/css/custom-styles.css" rel="stylesheet" />
    <!-- Google Fonts-->
    <link href="/static/css/open_sans.css" rel="stylesheet" />

    <style type="text/css">
        * {
            outline: 0;
            padding: 0;
            margin: 0;
            border: 0;
        }
        span{
            color: red;
            display: none
        }
    </style>
</head>
<body style="background: #4cae4c;height: 100%">
<div id="banner" style=" position: absolute;background: black">
    <img src="/static/images/banner.jpg" alt="" style="height: 100%;width: 100%;">
</div>
<!--<![endif]-->
<div id="wrapper" style="display: none;background: transparent;margin-top: 130px;height: auto">
    <!-- /. NAV SIDE  -->
<!-------------------------------------------------------------------------------------------------->
        <div id="page-inner" style="background: transparent;min-height:399px">
            <!-- /. ROW  -->
            <div class="row"  >
                <div class="col-lg-12" >
                    <div class="panel panel-default">
                        <div class="panel-body"  >
                            <div class="row">
                                <div class="col-lg-6">
                                    <h3 style="text-align: center;color: #4cae4c;margin-bottom: 10px">家长签到</h3>
                                    <!---->
                                    <form action="{:url('index/index/sign');}" method="post" role="form" onsubmit=" return check()">
                                        <div class="form-group" >
                                            <label style="margin-right: 20px">学生班级</label><span id="note_class" >请填入正确的班级格式</span>
                                            <input class="form-control" id="class" name="class" placeholder="二年级三班：02.3">
                                        </div>
                                        <div class="form-group">
                                            <label style="margin-right: 20px">学生姓名</label><span id="note_name">请填入学生姓名</span>
                                            <input class="form-control" id="name" name = "name">
                                        </div>
                                        <div class="form-group">
                                            <label style="margin-right: 20px">家长寄语</label><span id="note_message">请填入学生寄语</span>
                                            <textarea class="form-control" rows="3" id="message" name="message" placeholder="内容20字以内"></textarea>
                                        </div>
                                        <div style="width: 100%;text-align: center">
                                            <button type="submit" class="btn btn-success" style="width: 200px;margin: 0 auto">签到</button>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            <!-- /.row (nested) -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
        <!-- /. PAGE INNER  -->
    </div>
    <!-- /. PAGE WRAPPER  -->
    <!--------------------------------------------------------------------------------------------------------------------------->
    <!--<div class="row-fluid">-->
        <!--<div class="dialog">-->
            <!--<div class="block">-->
                <!--<p class="block-heading">签到</p>-->
                <!--<div class="block-body">-->
                    <!--<form action="{:url('index/index/sign');}" method="post" onsubmit=" return check()">-->
                        <!--<label>年级</label>-->
                        <!--<input name="grade" type="number" class="span12">-->
                        <!--<label>班级</label>-->
                        <!--<input name="class" type="number" class="span12">-->
                        <!--<label>姓名</label>-->
                        <!--<input name="name" type="text" class="span12">-->
                        <!--<div class="btn-toolbar">-->
                            <!--<input type="submit" value="签到" class="btn btn-primary"> <i class="icon-save"></i>-->
                        <!--</div>-->
                        <!--&lt;!&ndash;<label class="remember-me"><input type="checkbox">记住我</label>&ndash;&gt;-->
                        <!--<div class="clearfix"></div>-->
                    <!--</form>-->
                <!--</div>-->
            <!--</div>-->
            <!--&lt;!&ndash;<p class="pull-right" style=""><a href="http://www.portnine.com" target="blank">Theme by Portnine</a></p>&ndash;&gt;-->
            <!--&lt;!&ndash;<p><a href="reset-password.html">Forgot your password?</a></p>&ndash;&gt;-->
        <!--</div>-->
    <!--</div>-->
</div>

<!-- jQuery Js -->
<script src="/static/lib/jquery-1.10.2.js"></script>
<!-- Bootstrap Js -->
<script src="/static/lib/bootstrap.min.js"></script>
<!-- Metis Menu Js -->
<script src="/static/lib/jquery.metisMenu.js"></script>

<!--<script src="/static/lib/morris/morris.js"></script>-->
<!--<script src="/static/lib/morris/raphael-2.1.0.min.js"></script>-->
<!--&lt;!&ndash; Custom Js &ndash;&gt;-->
<!--<script src="/static/lib/custom-scripts.js"></script>-->
<script>
    setTimeout(function () {
        hide_banner()
    },3000)
    function hide_banner() {
        $("#banner").hide();
        $("#wrapper").show();
    }

    function check() {
        var regx =/^\d{2}[.]\d{1}$/;
        var grade = $("#class").val();
        if(!regx.test(grade)){
            $("#note_class").show();
            return false;
        }
        var name = $("#name").val();
        if(name.trim()==""){
            $("#note_class").hide();
            $("#note_name").show();
            return false;
        }
        var message = $("#message").val();
        if(message.trim()==""){
            $("#note_class").hide();
            $("#note_name").hide();
            $("#note_message").show();
            $("#note_message").text("请填入学生寄语");
            return false;
        }
        if(message.length>20){
            $("#note_class").hide();
            $("#note_name").hide();
            $("#note_message").show();
            $("#note_message").text("寄语超过20个文字");
            return false;
        }
    }
    //获取地址栏参数
    function getUrlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
        var r = window.location.search.substr(1).match(reg);  //匹配目标参数
        if (r != null) return unescape(r[2]); return null; //返回参数值
    }
    var back = getUrlParam("back");
    if(back==1){
        $("#banner").hide();
        $("#wrapper").show();
    }
</script>
</body>
</html>


